package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

func main() {
	ioString := strings.NewReader("hello wrold!")

	bufReader := bufio.NewReader(ioString)
	data, _ := bufReader.Peek(10)

	fmt.Println(data, bufReader.Buffered())

	data2, _ := bufReader.ReadString(' ')
	fmt.Println(data2, bufReader.Buffered())

	w := bufio.NewWriter(os.Stdout)
	fmt.Fprintln(w, "rrrrr")
	fmt.Fprintln(w, "world")
	w.Flush()
}
